from app01 import models
from app01.serializers import BookInfoSerializer, HeroSerializr

book = models.BookInfo.objects.get(id=1)
books = models.BookInfo.objects.all()

serializer = BookInfoSerializer(instance=book)
serializers = BookInfoSerializer(instance=books, many=True)

print(serializer.data)
print(serializers.data)

hero = models.HeroInfo.objects.get(id=1)
heroes = models.HeroInfo.objects.all()

serializerr = HeroSerializr(instance=hero)
serializerrs = HeroSerializr(instance=heroes, many=True)

print(serializerr.data)
print(serializerrs.data)






















